package org.login.logic.impl;

import java.util.Map;


import org.login.logic.LoginService;
import org.login.service.api.impl.AdminServiceImpl;
import org.shop.validate.context.CheckParam;

import com.alibaba.dubbo.config.annotation.Service;

@Service(
        version = "1.0.0",
        application = "${dubbo.application.id}",
        protocol = "${dubbo.protocol.id}",
        registry = "${dubbo.registry.id}"
)
public class AdminLogicServiceImpl  implements LoginService{
	
	
	public Map<String, Object> login(Map<String, String> map) {
		// TODO Auto-generated method stub
		
		AdminServiceImpl adminImpl = new AdminServiceImpl(map);
		
		CheckParam checkParam = new CheckParam(adminImpl.getValidateCheckLogin(), map);
		
		boolean isSuccess = checkParam.checkParam();

		if(!isSuccess) {
			return null;
		}
		
		return adminImpl.checkLogin();
	}
	
}
